import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
function resolve(com){
  return (rs) => require([com], rs)
}
const routes = [
  { path: '/',
    redirect: '/index'
  },
  { path: '/index',
    name: 'index',
    hidden: false,
    component: () => import('@/views/index.vue'),
    meta: { title: '主页', },
    children: [
      {
        path: '/programCat',
        name: 'programCat',
        hidden: true,
        component: ()=> import('@/views/home/programCat.vue')
      },
      {
        path: '/towerAndFire',
        name: 'towerAndFire',
        hidden: true,
        component: ()=> import('@/views/home/towerAndFire.vue')
      },
      {
        path: '/calc',
        name: 'calc',
        hidden: false,
        meta: {title: '自动出题'},
        component: ()=> import('@/views/home/calc.vue')
      }
    ]
  },
  {
    path: '/pxsGame',
    name: 'pxsGame',
    hidden: false,
    meta: {title: '自动出题'},
    component: ()=> import('@/views/pxsGame/index.vue'),
    redirect: '/pxsGame/menu',
    children: [
      {
        path: 'menu',
        name: 'menu',
        hidden: false,
        meta: {title: '自动出题'},
        component: ()=> import('@/views/pxsGame/menu.vue'),
      },
      {
        path: 'game',
        name: 'game',
        hidden: false,
        meta: {title: '自动出题'},
        component: ()=> import('@/views/pxsGame/game.vue'),
      }
    ]
  },
  
]

const router = new VueRouter({
  routes
})

export default router

